//
//  BaseVC.m
//  ZNZ
//
//  Created by  zyn on 15/12/18.
//  Copyright © 2015年 com.znz.demo. All rights reserved.
//

#import "BaseVC.h"

@interface BaseVC ()

@end

@implementation BaseVC

- (void)viewDidLoad {
    [super viewDidLoad];
    dataManager = [DataManager newInstance];
}

- (void)viewWillAppear:(BOOL)animated {
    
    [super viewWillAppear:animated];
//    if (self.isHidenTabBar) {
//        UIWindow *window=[UIApplication sharedApplication].keyWindow;
//        RootTabVC *tabBarVC=(RootTabVC *)window.rootViewController;
//        tabBarVC.tabbar.hidden=YES;
//    }else{
//        UIWindow *window=[UIApplication sharedApplication].keyWindow;
//        RootTabVC *tabBarVC=(RootTabVC *)window.rootViewController;
//        tabBarVC.tabbar.hidden=NO;
//    }
    [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent animated:NO];
}

- (void)viewWillDisappear:(BOOL)animated {
    
    [super viewWillDisappear:animated];
//    if (self.isHidenTabBar) {
//        UIWindow *window=[UIApplication sharedApplication].keyWindow;
//        RootTabVC *tabBarVC=(RootTabVC *)window.rootViewController;
//        tabBarVC.tabbar.hidden=NO;
//    }
    
}

-(void)initializeView{
}

-(void)initializeData{
    
    
}


-(void)back{
    [self.navigationController popViewControllerAnimated:YES];
    
}


-(void)push:(Class) cls{
    id instance = [[cls alloc]init];
    [self.navigationController pushViewController:instance animated:YES];
}

-(void)push:(Class)cls bundle:(void (^)(id vc))bundle{
    id instance = [[cls alloc]init];
    if (bundle)
        bundle(instance);
    [self.navigationController pushViewController:instance animated:YES];
}

- (void)presentVC:(Class)cls animated:(BOOL)flag completion:(void (^ __nullable)(void))completion NS_AVAILABLE_IOS(5_0){
    id instance = [[cls alloc]init];
    [self.navigationController presentViewController:instance animated:flag completion:^{
        //completion
        if(completion){
            completion();
        }
    }];
}


@end
